<html>

<head>

<link rel="stylesheet" type="text/css" href="${def:context}/default.css" />

<!--biblioteca generica JS/Dinamica-->
<script type="text/javascript" src="${def:context}/action/script">
	</script>
<script language="JavaScript" type="text/javascript" src="${def:context}/js/getResponse.js"></script>
<title>更改房源状态</title>

</head>

<body>

<!--banner-->
<div class="banner" style="height: 15px; margin-bottom: 0px; font-weight: normal">
	<div style="float: left">更改房源状态</div>
	<div style="float: right">
		<img src="${def:context}/images/close.gif" class="button" onclick="parent.pickClose()" title="关闭">
	</div>
</div>
<center>
<div id="form">
<form name="form2" style="margin-top:0px;margin-bottom:0px;">
<input name="h_tuid" type="hidden" value="${fld:h_tuid}">
<input name="house_status" type="hidden" value="${fld:house_status}">
<TABLE class="table_comm" cellSpacing=0 cellPadding=0 width="100%" border=0>
	<tr>
		<td class="th20">楼号</td>
		<td class="td20left">
			<input name="house_name" type="text" size="10" maxlength="25" value="${fld:house_name}" readonly>
		</td>
	</tr>
	<tr>
		<td class="th20">原状态</td>
		<td class="td20left">
			<input name="old_status" type="text" size="10" maxlength="25" value="${fld:old_status}" readonly>
		</td>
	</tr>
	<tr>
		<td class="th20">新状态</td>
		<td class="td20left">
			<select name="new_status">
				
			</select>
		</td>
	</tr>
	<tr>
		<td align="center" colspan=1>
			<input type="button" class="cmd" value="更改状态" onclick="return updateStatus()">
		</td>
		<td>
			<input type="button" class="cmd" value="关闭" onclick="javascript:parent.pickClose();" >
		</td>
		<td align="center" colspan=1>
			<input type="button" class="cmd" value="删除房源" onclick="return deleteHouse()">
		</td>
	</tr>
</table>
</form>
</div>

<div id="status" class="alert" style="display: none; color: gray; width: 60%; font-weight: normal; font-family: Arial; margin-top: 10px">
	<img src="${def:context}/images/progress.gif"> 请等待
</div>

<!--panel de respuesta AJAX-->
<div id="response" style="display: none; width: 100%; margin-top: 7px">
</div>

</center>

</body>

<!--codigo de soporte del template-->
<script type="text/javascript">

		function updateStatus()
		{
			if(document.form2.new_status.value == ""){
				alert("请选择新状态！");
				return false;
			}
			return ajaxCall(	httpMethod="POST", 
								uri="${def:actionroot}/update", 
								divResponse=null, 
								divProgress="status", 
								formName="form2", 
								afterResponseFn=null, 
								onErrorFn=null);
		}

		function deleteHouse()
		{
      if (window.confirm("确认删除该房号吗?")==false)
      {
          return false;
      }
			
			return ajaxCall(	httpMethod="POST", 
								uri="${def:actionroot}/delete", 
								divResponse=null, 
								divProgress="status", 
								formName="form2", 
								afterResponseFn=null, 
								onErrorFn=null);
		}
		
		window.onload = function(){
			document.form2.new_status.options.length = 0;
			option = new Option("请选择");
			option.value = "";
			document.form2.new_status.options.add(option);
			if("${fld:house_status}" == "1"){
				option = new Option("暂保留");
				option.value = "8";
				document.form2.new_status.options.add(option);
				option = new Option("不可分配");
				option.value = "9";
				document.form2.new_status.options.add(option);
			}else if("${fld:house_status}" == "8" || "${fld:house_status}" == "9"){
				option = new Option("可分配");
				option.value = "1";
				document.form2.new_status.options.add(option);
			}
			
		}
</script>


</html>
